package com.alog.senior.day13;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @Auther: Ye Zhengdong
 * @Date: 2019/1/21 16:41
 * @Description:
 */
public class DouDiZhu {
    public static void main(String[] args) {
        ArrayList<String> poker = new ArrayList<>();
        String[] colors = {"♥", "♦", "♠", "♣"};
        String[] nums = {"A", "2", "3", "4","5", "6", "7", "8","9", "10", "J", "Q", "K"};
        poker.add("大王");
        poker.add("小王");

        for(String num : nums){
            for(String color : colors){
                poker.add(color + num);
            }
        }

        Collections.shuffle(poker);
        List<String> player1 = new ArrayList<>();
        List<String> player2 = new ArrayList<>();
        List<String> player3 = new ArrayList<>();
        List<String> dipai = new ArrayList<>();

        for (int i = 0; i < poker.size(); i++) {
            if(i >= 51){
                dipai.add(poker.get(i));
                continue;
            }
            switch (i % 3){
                case 0:
                    player1.add(poker.get(i));
                    break;
                case 1:
                    player2.add(poker.get(i));
                    break;
                case 2:
                    player3.add(poker.get(i));
                    break;
            }
        }
        System.out.println(poker);
        System.out.println(player1);
        System.out.println(player2);
        System.out.println(player3);
        System.out.println(dipai);
    }
}
